package com.otp.Activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by Administrator on 2015/12/30.
 */
public class Splash extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        int flag= WindowManager.LayoutParams.FLAG_FULLSCREEN;
        Window window=Splash.this.getWindow();
        window.setFlags(flag, flag);
        setContentView(R.layout.splash);
        new Thread(new Thread() {
            @Override
            public void run() {
                try {
                    this.sleep(3000);
                    Intent intent = new Intent();
                    intent.setClass(Splash.this,DashBoard.class);
                    startActivity(intent);
                    Splash.this.finish();
                } catch (InterruptedException ex){
                    ex.printStackTrace();
                }
            }
        }).start();
    }

    @Override
    protected void onResume() {
        super.onResume();
        JPushInterface.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        JPushInterface.onPause(this);
    }
}
